﻿create procedure dbo.UnsubscribeAudience
(
		@UserID int,
		@AudienceID int
	)

AS

DECLARE @iCount int

SET @iCount = (SELECT Count(UserID) FROM dbo.AudienceMembers WHERE UserID = @UserID AND AudienceID = @AudienceID)

IF @iCount > 0
	BEGIN
		
		DELETE FROM dbo.AudienceMembers
			WHERE     (UserID = @UserID) AND (AudienceId = @AudienceID)


	END
	
RETURN


